<template>
  <div>
    <h1>生产</h1>
    <el-table
        :data="tableData"
        style="width: 100%">
      <el-table-column
          prop="id"
          label="id"
          width="180">
      </el-table-column>
      <el-table-column
          prop="title"
          label="title"
          width="180">
      </el-table-column>
      <el-table-column
          prop="sum"
          label="sum">
      </el-table-column>
      <el-table-column
          prop="addressBegin"
          label="addressBegin">
      </el-table-column>
      <el-table-column
          prop="addressEnd"
          label="addressEnd">
      </el-table-column>
      <el-table-column
          prop="createTime"
          label="createTime">
      </el-table-column>
      <el-table-column
          prop="totalAmount"
          label="totalAmount">
      </el-table-column>
      <el-table-column
          prop="outTradeNo"
          label="outTradeNo">
      </el-table-column>
    </el-table>
    <el-pagination
        @current-change="goPage"
        :page-size="size"
        layout="total, prev, pager, next"
        :total="total">
    </el-pagination>
  </div>
</template>

<script>
export default {
  name: "ProductView",
  data() {
    return {
      tableData:[],
      product:{},
      total:0,
      size:3,
      current:1,
    }
  }, methods: {
    goPage(page){
      this.current = page;
      this.list();
    },
    list(){
      this.axios.post("/product/productList?current="+this.current+"&size="+this.size,this.product).then(res=>{
        this.tableData = res.data.data.list;
        this.total = res.data.data.total;
      })
    }
  }, created() {
    this.list();
  }
}
</script>

<style scoped>

</style>
